<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        function sum(num1, num2) {
            this.sum = num1 + num2;
        }

        var obj = {
            name: '王宝宝'
        }

        var f = sum.bind(obj, 20, 30);
        f();
        console.log(obj);

        function fn() {
            console.log(this);
        }

        var o = { age: 18 };
        var f1 = fn.bind(o);
        f1();
    </script>
</body>

</html>